﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class css_huandingp_tupian : System.Web.UI.Page
{
    public int Sid1;
    public int Sid2;
    public int Sid3;
    public int Sid4;
    public string image1 = "";
    public string image2 = "";
    public string image3 = "";
    public string image4 = "";
    public string imageName1 = "";
    public string imageName2 = "";
    public string imageName3 = "";
    public string imageName4 = "";
    public string content1 = "";
    public string content2 = "";
    public string content3 = "";
    public string content4 = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string SqlstringSid1 = "select top 1 newsID from newsimage where imaplace is not null order by newsID desc";

            Sid1 = int.Parse(SQL.GetData(SqlstringSid1, "newsID"));
            string Sqlstringimage1 = "select imaplace from newsimage where newsID=" + Sid1 + "";
            image1 = SQL.GetData(Sqlstringimage1, "imaplace");
            string SqlstringimageName1 = "select newsname from newsimage where newsID=" + Sid1 + "";
            imageName1 = SQL.GetData(SqlstringimageName1, "newsname");
            content1 = LimitNum.Limit(imageName1, 25);

            string SqlstringSid2 = "select top 1 newsID from newsimage where imaplace is not null and newsID<" + Sid1 + " order by newsID desc";

            Sid2 = int.Parse(SQL.GetData(SqlstringSid2, "newsID"));
            string Sqlstringimage2 = "select imaplace from newsimage where newsID=" + Sid2 + "";
            image2 = SQL.GetData(Sqlstringimage2, "imaplace");
            string SqlstringimageName2 = "select newsname from newsimage where newsID=" + Sid2 + "";
            imageName2 = SQL.GetData(SqlstringimageName2, "newsname");
            content2 = LimitNum.Limit(imageName2, 25);

            string SqlstringSid3 = "select top 1 newsID from newsimage where imaplace is not null and newsID<" + Sid2 + " order by newsID desc";

            Sid3 = int.Parse(SQL.GetData(SqlstringSid3, "newsID"));
            string Sqlstringimage3 = "select imaplace from newsimage where newsID=" + Sid3 + "";
            image3 = SQL.GetData(Sqlstringimage3, "imaplace");
            string SqlstringimageName3 = "select newsname from newsimage where newsID=" + Sid3 + "";
            imageName3 = SQL.GetData(SqlstringimageName3, "newsname");
            content3 = LimitNum.Limit(imageName3, 25);

            string SqlstringSid4 = "select top 1 newsID from newsimage where imaplace is not null and newsID<" + Sid3 + " order by newsID desc";

            Sid4 = int.Parse(SQL.GetData(SqlstringSid4, "newsID"));
            string Sqlstringimage4 = "select imaplace from newsimage where newsID=" + Sid4 + "";
            image4 = SQL.GetData(Sqlstringimage4, "imaplace");
            string SqlstringimageName4 = "select newsname from newsimage where newsID=" + Sid4 + "";
            imageName4 = SQL.GetData(SqlstringimageName4, "newsname");
            content4 = LimitNum.Limit(imageName4, 25);

        }
    }
}
